Databases often allocate large, multiple, contiguous memory segments from the kernel, and use dynamic storage allocators to manage them as heaps. The dynamic storage allocators are known as heap managers. When a query deallocates memory that was obtained from a heap, the heap manager adds the deallocated memory to a list of free blocks.
Typically, the heap manager does not communicate with the operating system regarding the freed blocks. As such, the blocks are not freed as far as the operating system is concerned. This results in artificial memory pressure because otherwise available memory is not being made available to the operating system.
Further, because the operating system memory manager is not aware of the free blocks, disk input/output operations (I/Os) may be wasted. The operating system memory manager may swap out dirty pages to disk periodically. If the dirty pages swapped out to disk are located within freed blocks of memory, there is no need to swap the pages out to disk. This results in unnecessary disk I/Os. Additionally, if the database reallocates the heap memory that was freed, the pages may be swapped in from the disk. This may result in unnecessary I/O as the database no longer needs the data present in the memory pages before they were freed.